
exports.speak = function (text, successCallback, errorCallback) {
    var options = {};
    if (typeof text == 'string') {
        options.text = text;
    } else {
        options = text;
    }
    cordova.exec(successCallback, errorCallback, "TTS", "speak", [options]);
};

exports.stop = function() {
    return new Promise(function (resolve, reject) {
        cordova.exec(resolve, reject, 'TTS', 'stop', []);
    });
};

exports.checkLanguage = function() {
    return new Promise(function (resolve, reject) {
        cordova.exec(resolve, reject, 'TTS', 'checkLanguage', []);
    });
};

exports.openInstallTts = function() {
    return new Promise(function (resolve, reject) {
        cordova.exec(resolve, reject, 'TTS', 'openInstallTts', []);
    });
};
